package com.pubinfo.passbook.esb.controller;

import com.pubinfo.passbook.common.model.bo.eip.ReceiveTaskParam;
import com.pubinfo.passbook.common.model.bo.eip.ReceiveTaskResult;
import com.pubinfo.passbook.task.EipTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "eip")
@Api(tags = "eip待办相关接口")
@Slf4j
public class EipController {
  @Autowired
  EipTaskService taskService;
  
  @PostMapping("receiveTaskInfo")
  @ApiOperation(value = "待办更新接口")
  public ReceiveTaskResult sendShortMessage(@RequestBody List<ReceiveTaskParam> taskParams) {
    return taskService.receiveTaskInfo(taskParams);
  }
  
  @PostMapping("finishedTask")
  @ApiOperation(value = "待办清除接口")
  public ReceiveTaskResult finishedTask(@RequestBody String taskId) {
    return taskService.finishedTask(taskId);
  }
}
